<?php 
$pageTitle = "Upload";
include_once "common/header.php"; 

	if(!empty($_POST['name']) &&!empty($_FILES['files'])):
		include_once "common/inc/class.blocks.inc.php";
		$upBlocks = new GenericBlocks($db);
		$upBlocks->createNewBlocks();
		exit;
	

	else:
?>


	

	<body>
	
	<?php include_once "common/user-menu.php"; ?>
	<link rel="stylesheet" type="text/css" href="css/user/myblocks.css" />
	<link href="css/uploadblocks/uploadblocks.css" rel="stylesheet" />
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>

	<script type="text/javascript" src="scripts/myblocks/jquery.wallform.js"></script>
	<script src="scripts/uploadblocks/jquery.knob.js"></script>

		<!-- jQuery File Upload Dependencies -->
		<script src="scripts/uploadblocks/jquery.ui.widget.js"></script>
		<script src="scripts/uploadblocks/jquery.iframe-transport.js"></script>
		<script src="scripts/uploadblocks/jquery.fileupload.js"></script>
		
		<!-- Our main JS file -->
		<script src="scripts/uploadblocks/uploadblocks.js"></script>
		<script type="text/javascript" src="scripts/myblocks/myblocks.js"></script>
	
	
	
	<div class = "myblocks-container">
		<h2>my blocks</h2>
			<div class="seperator"></div>
				
				<ul class ="myblocks">
				<li><div class="addOverl"></div><img class="addBlocks" src ="../dir/common/user/images/thumb_empty.jpg" title="add"/><div class="editTag">Add New Blocks<div></li>
				</ul>
				
	</div>
	
	
	<div class ="widget-container">
		<div id = "manage-content">
			<h2> Manage </h2>
			
			<div id="manage-main">
			<aside>
			<a id ="edit-pages">Add/Delete Pages</a>
			</aside>
			<form>
				<div class="m-wrapper">
				<label>Title:</label>
					
				<input id="title" type="text" placeholder=""  name = "Title" />
				<label id="title_val"></label>
				<a id="edit_title">Edit</a>
				</div>
				<div class="m-wrapper">
				<label>Synopsis:</label>
				<br />
				<p id="m_synopsis-val"></p>
				<textarea id="m_synopsis" name="synopsis" placeholder="Summary of your block..." ></textarea>  
				<a id="edit_synopsis">Edit</a>
				</div>
				<div class="m-wrapper">
				<div class="category">
					 <label>Gategory:</label>
					 <br />
					 <input type = "checkbox"
						 id = "category"
						 value = "Action & Adventure" />
					 <label for = "Action & Adventure">Action & Adventure</label>
					 <input type = "checkbox"
						 id = "category"
						 value = "Manga" />
					 <label for = "Manga">Manga</label>
					 <input type = "checkbox"
						 id = "category"
						 value = "Comedy" />
					 <label for = "Comedy">Comedy</label>
					 <input type = "checkbox"
						 id = "category"
						 value = "Drama" />
					 <label for = "Drama">Drama</label>
					 <input type = "checkbox"
						 id = "category"
						 value = "Romance" />
					 <label for = "Romance">Romance</label>
					 <input type = "checkbox"
						 id = "category"
						 value = "Horror & Thriller" />
					 <label for = "Horror & Thriller">Horror & Thriller</label>
				</div>
				</div>
			<form>
			<a class ="button">Save</a>
			</div>
			<div id="manage-pages">
				
	</div>

		<div class="uploadblocks-content">
			
			<h2>add new block +  </h2>
			<h3>Step 1: Block Details</h3>
			<div class="seperator"></div>
				<div id ="progress_bar">
				<ul>
					<li>1</li>
					<li>2</li>
					<li>3</li>
				</ul>
				 <div id="progress"></div>
				
			</div>
				<div id="first_step"> <!-- FIRST STEP --->

				<form action="" enctype="multipart/form-data">
				<input class="textfield" type="text" placeholder="Title" required="" name = "Title">
				<br/>
				<label for="synopsis">Synopsis</label>
				<br />
				<textarea class="synopsis" name="synopsis" placeholder="Summary of your block..." required="required" data-minlength="20"></textarea>  
				<br />
				<label>Category:</label>
				<div class="category">
					 <input type = "checkbox"
						 id = "category"
						 value = "Action & Adventure" />
					 <label for = "Action & Adventure">Action & Adventure</label>
					 <input type = "checkbox"
						 id = "category"
						 value = "Manga" />
					 <label for = "Manga">Manga</label>
					 <input type = "checkbox"
						 id = "category"
						 value = "Comedy" />
					 <label for = "Comedy">Comedy</label>
					 <input type = "checkbox"
						 id = "category"
						 value = "Drama" />
					 <label for = "Drama">Drama</label>
					 <input type = "checkbox"
						 id = "category"
						 value = "Romance" />
					 <label for = "Romance">Romance</label>
					 <input type = "checkbox"
						 id = "category"
						 value = "Horror & Thriller" />
					 <label for = "Horror & Thriller">Horror & Thriller</label>
				</div>
				<br />
				
				<input class ="button" type="submit" value="Next" id="next_first" />
				</form>
			</div> <!-- FIRST STEP --->
			<div id ="second_step"> <!-- Second STEP --->
				<form id="upload" method="post" action="upload-pages.php" enctype="multipart/form-data">
				<div id ="upload-input">
				<a>Browse</a>
				<input type="file" name="upl" multiple />
				</div>
			<div id="upload-items">
			<ul>
				<!-- The file uploads will be shown here -->
			</ul>
			</div>
			
		</form>	
			<form id="upload_2" method="post" action="upload-blocks.php">
				<input class ="button" type="submit" value="Next" id="next_second" />
				<input type="hidden" name="name" id="h_t" value="">
				<input type="hidden" name="synopsis" id="h_s" value="">
			</form>
			</div> <!-- Second STEP --->
			<div id ="third_step">  <!-- Third STEP -->
				
			</div> <!-- Third STEP -->
			<div id ="processing">  <!-- processing -->
				<label>loading...</label>
			</div> <!-- processing-->
	
		
	</body>
</html>
<?php endif?>